package com.freecat.xmqgct.mvp.ui.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

public class ViewPAdapter extends FragmentPagerAdapter {

    private FragmentManager fragmetnmanager;  //创建FragmentManager
    private List<Fragment> listfragment; //创建一个List<Fragment>
    private List<String> dat ;


    public ViewPAdapter(FragmentManager fm, List<Fragment> list, List<String> dat) {
        super(fm);
        this.fragmetnmanager = fm;
        this.listfragment = list;
        this.dat = dat;
    }

    @Override
    public Fragment getItem(int arg0) {
        return listfragment.get(arg0);
    }

    @Override
    public int getCount() {
        return listfragment.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return dat.get(position);
    }
}
